<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>订单管理 </title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <!-- Data Tables -->
    <link href="css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">
    <link href="css/plugins/dataTables/dataTables.responsive.css" rel="stylesheet">
    <link href="css/plugins/dataTables/dataTables.tableTools.min.css" rel="stylesheet">
    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="css/css.css" />
</head>
<body style="background-color:white">
	 <div class="pageTop" style="position:relative;height:50px">
            <div class="page">
                <img src="img/coin02.png" /><span><a href="main.do">首页</a>&nbsp;-&nbsp;-</span>&nbsp;<a href="getAllOrders.do">订单管理</a>
            </div>
     </div>
    <div class="row">
                <div class="col-lg-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                           <button class="userbtn" onclick="window.location.href='toaddOrder.do'" 
	  						style="border-radius:15px;font-size: 10px;color: #fff;background-color: #47a4e1;width:80px;height:40px;">新增订单</button>	
                        </div>
                        <div class="ibox-content">
                            <table class="table table-striped table-bordered table-hover" id="editable">
                                    <thead>
			                        	<tr>
											<th style="text-align:center">编号</th>
	                                        <th style="text-align:center">产品名称</th>
	                                        <th style="text-align:center">机构名称</th>
	                                        <th style="text-align:center">产品状态</th>
	                                        <th style="text-align:center">经办人</th>
	                                        <th style="text-align:center">联系人</th>
	                                        <th style="text-align:center">使用状态</th>
	                                        <th style="text-align:center">开通日期</th>
	                                        <th style="text-align:center">操作</th>
										</tr>
                                    </thead>
                                    <tbody>
                            <c:forEach items="${orderlist }" var="map">
							<tr height="40px">
							<td>${map.id }</td>
							<td>${map.oname }</td>
							<td>${map.orgname }</td>
							<!-- 产品状态判断 -->
							<td>
								<c:if test="${map.prostate eq 0 }">未开通</c:if>
								<c:if test="${map.prostate eq 1 }">开通</c:if>
							</td>
							
							<td>${map.ename }</td>
							<td>${map.contact }</td>
							<!-- 使用状态判断 -->
							<td>
								<c:if test="${map.usestate eq 1 }">未使用</c:if>
								<c:if test="${map.usestate eq 2 }">试用</c:if>
								<c:if test="${map.usestate eq 3 }">正式使用</c:if>
							</td>
							<td>${map.passdate }</td>
							<td>
								<a href="toupdateOrder.do?id=${map.id }"><img class="operation" src="img/update.png"></a> 
								<a href="toproductDetail.do?id=${map.id}"><img class="operation" src="img/view.png"></a>
								<a onclick="if(confirm('确定删除?')==false)return false" href="orderDel.do?oid=${map.id }" ><img class="operation delban" src="img/delete.png" <%-- onclick="fun(${map.id})" --%>></a>
							</td>
							</tr>
						</c:forEach>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
        
<!-- Mainly scripts -->
<script src="js/jquery-2.1.1.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="js/plugins/slimscroll/jquery.slimscroll.min.js"></script>

<!-- Data Tables -->
<script src="js/plugins/dataTables/jquery.dataTables.js"></script>
<script src="js/plugins/dataTables/dataTables.bootstrap.js"></script>
<script src="js/plugins/dataTables/dataTables.responsive.js"></script>


<!-- Custom and plugin javascript -->
<script src="js/inspinia.js"></script>

<!-- Page-Level Scripts -->
<script>
   $(document).ready(function () {
        $('.dataTables-example').dataTable({
            responsive: true,
            "dom": 'T<"clear">lfrtip',
            "tableTools": {
                "sSwfPath": "js/plugins/dataTables/swf/copy_csv_xls_pdf.swf"
            }
        });

        /* Init DataTables */
        var oTable = $('#editable').dataTable();

        /* Apply the jEditable handlers to the table */
        oTable.$('td').editable('../example_ajax.php', {
            "callback": function (sValue, y) {
                var aPos = oTable.fnGetPosition(this);
                oTable.fnUpdate(sValue, aPos[0], aPos[1]);
            },
            "submitdata": function (value, settings) {
                return {
                    "row_id": this.parentNode.getAttribute('id'),
                    "column": oTable.fnGetPosition(this)[2]
                };
            },

            "width": "90%",
            "height": "100%"
        });

    });

    function fnClickAddRow() {
        $('#editable').dataTable().fnAddData([
            "Custom row",
            "New row",
            "New row",
            "New row",
            "New row"]);

    }

</script>

</body>
</html>
